
#ifndef OBJ_H
#define OBJ_H

#include"ray.h"

class Object
{
  protected:
  float color[3];
  float shine;
  float reflec;
  float mat_inv[16];
  float mat_it[16];
  public:
  //caso nao seja shadow deve setar a normal e o ponto do shadow e o tmin
  virtual bool Hit(Ray *r)=0;
  void SetColor(float r, float g, float b, float sh, float ref)
  {
    color[0]=r; color[1]=g; color[2]=b;
    shine = sh;
    reflec = ref;
  };
  void inline SetRayAtt (Ray * ray)
  {
    float* rcolor = ray->obj_color;
    rcolor[0] = color[0];
    rcolor[1] = color[1];
    rcolor[2] = color[2];
    if(shine==-1.0)
      ray->obj_nospec=true;
    else{
      ray->obj_shine = shine;
      ray->obj_nospec=false;
    }
    ray->obj_reflec = reflec;
  };
  float * GetMInvPointer ()
  {
    return mat_inv;
  };
  float * GetMITPointer ()
  {
    return mat_it;
  };
};

#endif

